home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Lease.java < prev    next >
Text File  |  1998-09-22  |  1KB  |  52 lines

  1. /*
  2.  * @(#)Lease.java    1.3 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.rmi.dgc;
  15.  
  16. /**
  17.  * A lease contains a unique VM identifier and a lease duration. A
  18.  * Lease object is used to request and grant leases to remote object
  19.  * references.
  20.  */
  21. public final class Lease implements java.io.Serializable {
  22.  
  23.     private VMID vmid;
  24.     private long value;
  25.  
  26.     /**
  27.      * Constructs a lease with a specific VMID and lease duration. The
  28.      * vmid may be null.
  29.      */
  30.     public Lease(VMID id, long duration) 
  31.     {
  32.     vmid = id;
  33.     value = duration;
  34.     }
  35.  
  36.     /**
  37.      * Returns the client VMID associated with the lease.
  38.      */
  39.     public VMID getVMID() 
  40.     {
  41.     return vmid;
  42.     }
  43.  
  44.     /**
  45.      * Returns the lease duration.
  46.      */
  47.     public long getValue() 
  48.     {
  49.     return value;
  50.     }
  51. }
  52.